﻿using InnoWeb.CEND.Core.Model.Workshop;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Workshop
{
    public class WorkshopItemMapping: BaseMappingConfiguration<WorkshopItem, int>
    {
        public WorkshopItemMapping()
        {
            this.Property(a => a.Name).IsRequired().HasMaxLength(100);
            this.Property(a => a.NameTR).IsRequired().HasMaxLength(100);

            this.HasMany(a => a.WorkshopContents).WithRequired(a => a.WorkshopItem);

            this.Property(a => a.ExpertInfoId);
            this.HasRequired(a => a.Expert).WithMany(a => a.WorkshopItems).HasForeignKey(a => a.ExpertInfoId);
        }
    }
}
